package generatoreLALR;
import java.io.*;
%%

%class ScannerLex

%unicode
%line
%column

%public
%final
/*
%debug
*/
%byaccj

%{
private Parser yyparser;

public ScannerLex (Reader r,Parser yyparser) {
		this(r);
		this.yyparser = yyparser;
	}

%}



NL = \n
NUMBER = [0-9]+
PIU = "+"
MENO = "-"
PER = "*"
DIVISO = "/"

%%


{NL}    { 
		System.out.println("LETTO: "+yytext());
				return Parser.NL;}
{NUMBER}    { yyparser.yylval = new ParserVal(Double.parseDouble(yytext()));
		System.out.println("LETTO: "+yytext());
				return Parser.NUMBER;}
{PIU}    { 
		System.out.println("LETTO: "+yytext());
				return Parser.PIU;}
{MENO}    { 
		System.out.println("LETTO: "+yytext());
				return Parser.MENO;}
{PER}    { 
		System.out.println("LETTO: "+yytext());
				return Parser.PER;}
{DIVISO}    { 
		System.out.println("LETTO: "+yytext());
				return Parser.DIVISO;}